package com.bookocean.application.exception;

import lombok.Getter;

/**
 * @author gaoxing
 */
@Getter
public enum WeChatErrorCodeEnum {
    // 系统级错误码 (100-999)
    SUCCESS(0, "成功"),
    SYSTEM_ERROR(500, "系统异常"),
    PARAM_ERROR(400, "参数错误"),
    UNAUTHORIZED(401, "鉴权失败"),
    FORBIDDEN(403, "禁止访问"),
    NOT_FOUND(404, "资源不存在"),
    HTTP_REQUEST_ERROR(405, "HTTP请求失败"),
    DECRYPT_ERROR(406, "消息解密失败"),
    ENCRYPT_ERROR(407, "消息加密失败"),

    // 微信级错误码 (1000-1999)
    WE_CHAT_LOGIN_ERROR(1000, "调用微信登录接口失败"),
    BOOK_OCEAN_GET_USER_INFO_ERROR(1001, "调用书海登录接口失败"),
    //修改接口失败
    UPDATE_USER_INFO_ERROR(1002, "修改用户信息失败"),

    // 书籍相关错误码 (2000-2999)
    SAVE_BOOK_ERROR(2000, "保存书籍失败"),
    GET_BOOK_INFO_ERROR(2001,"查询书籍失败"),
    UPDATE_BOOK_INFO_ERROR(2002,"修改书籍失败"),
    SAVE_QUOTE_ERROR(2003,"保存书摘信息失败"),
    
    // 小说相关错误码 (3000-3999)
    CREATE_NOVEL_ERROR(3000, "创建小说失败"),
    GET_NOVEL_ERROR(3001, "查询小说失败"),
    UPDATE_NOVEL_ERROR(3002, "更新小说失败"),
    DELETE_NOVEL_ERROR(3003, "删除小说失败"),
    GET_NOVEL_LIST_ERROR(3004, "查询小说列表失败"),
    ADD_PARTICIPANT_ERROR(3005, "添加参与者失败"),
    GET_PARTICIPANTS_ERROR(3006, "查询参与者失败"),
    CHECK_PARTICIPANT_ERROR(3007, "检查参与者身份失败"),
    ADD_CHAPTER_ERROR(3008, "添加章节失败"),
    GET_CHAPTERS_ERROR(3009, "查询章节失败"),
    GET_CHAPTER_ERROR(3010, "查询章节详情失败"),
    GET_CHAPTER_NUMBER_ERROR(3011, "获取章节序号失败"),
    CHECK_WRITING_STATUS_ERROR(3012, "检查写作状态失败"),
    GET_NEXT_WRITER_ERROR(3013, "获取下一个写作者失败");
    private final Integer code;
    private final String message;

    WeChatErrorCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
} 